Repository navigation
fix(cases): only refuse the cases folder and its direct children for a custom-folder case - #567
Conversation
7499f73 to
4796ca6
Compare
…a custom-folder case blockedReason() refused every path below a cases directory, with the reason that it is "already listed as a local case". GET /api/cases lists only the direct children of the cases directory, so only those can be registered twice. With CODEMAN_CASES_PATH set to a broad root such as /mnt/user/Scripts, the rule blocked almost the whole tree, including folders that are already linked cases. Refuse the cases directory itself and its direct children only, and name the cases directory in the message.
4796ca6 to
2f8e037
Compare
|
Thanks @opticon454, and sorry this one sat for so long without a word. It is a clean fix: Create New with a custom folder now refuses only the cases folder itself and its direct children, so a broad A few small things, mostly docs:
These are small, so I will apply them on top at merge time; no need to push again unless you would like to do them yourself. Thanks again for the clear write-up, here and in #637. |
…t children docs/api-reference.md and the case-path.ts @fileoverview still said a custom folder must not be, or be inside, the cases directory. After #567 only the cases directory itself and its direct children are refused (those are what GET /api/cases lists as local cases); a folder further down is allowed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t child The one message read "That folder is in the cases folder (...), where it is already listed as a case" for the cases folder itself too, which is not in itself and is never listed, and "already listed" is not true for a direct child that does not exist yet. Two messages now, both still pointing at plain Create New. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…directory Pins the user-facing fix end to end: POST /api/cases with a path two levels down returns 200, lands in the linked-cases registry and is scaffolded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… its direct children for a custom-folder case Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Merged and shipped in 1.43.0. Thanks @opticon454, and sorry again for the long wait on this one. As promised, the merge-time commits on top: |
Problem
Add Case → Create New → custom folder refuses any folder below the cases directory with "That folder is inside the cases folder; create a case there with plain Create New". The stated reason is that such a folder is already listed as a local case, but
GET /api/caseslists only the direct children of the cases directory. A deeper folder is not listed, so linking it cannot register it twice.It matters when
CODEMAN_CASES_PATHis a broad root. With/mnt/user/Scripts, a new case at/mnt/user/Scripts/GitHub/me/new-projectwas refused, although existing linked cases already live at that depth.Change
blockedReason()(src/web/case-path.ts) now refuses the cases directory itself and its direct children only. The message names the cases directory. The resolved-path (symlink) check is unchanged, because it goes through the same function.Tests
test/case-path.test.ts: direct children and the cases directory itself are still refused (message names the folder); a folder two or more levels down, under a broad cases root, is allowed.tsc --noEmitclean.test/routes/case-custom-path-routes.test.tsonly uses direct children, so it is unaffected (it refuses to run outsidenpm test).